<?php
/*
 * 接口：/customer/delete
 * 说明：删除客户
 */
 
$db->mysqlDB->falseAutoCommit();

//获取请求参数
$params = $route->bodyParams;

//删除客户
$P1 = array(
	"update_where" => "oc_id",
	"oc_id" => $params['oc_id'],
	"oc_is_delete" => 1
);
$R1 = $db->mysqlDB->automaticUpdate($P1)->update("easyd_oa_customer");

//删除客户负责人
$P2 = array(
	"update_where" => "ocu_uid,ocu_ocid",
	"ocu_uid" => $params['ocu_uid'],
	"ocu_ocid" => $params['oc_id'],
	"ocu_is_delete" => 1
);
$R2 = $db->mysqlDB->automaticUpdate($P2)->update("easyd_oa_customer_user");


if(!$R1||!$R2){
    $db->mysqlDB->rollBackCommint();
    $db->mysqlDB->trueAutoCommit();
    $response->responseData( false );
}else{
    $db->mysqlDB->actionCommint();
    $db->mysqlDB->trueAutoCommit();
    $response->responseData( true );
}


?>